<extend name="Public/base" />

<block name="body">
  <!-- 按钮工具栏 -->
  <div class="cf">
    <div class="fl">
      <!--<button class="btn ajax-post confirm" url="{:U('del')}" target-form="ids">删 除</button>>
      <button-- class="btn ajax-post confirm" target-form="ids" url="{:U('setStatus',array('status'=>-1))}">删 除</button-->
      <a class="btn" href="{:U('bill')}">刷 新</a>（点击"刷新"按钮清除搜索条件，显示全部信息。）
    </div>
      <!-- 高级搜索 -->
      <form action="{:U('bill')}" method="GET" id="J_search-form">
          <div class="search-form fr cf">
              <div class="sleft">
                  <input type="text" name="store" class="search-input w-150" value="{:I('store')}" placeholder="店铺名称">
              </div>
              <div class="fl">
                  状态筛选：
                  <select name="status">
                      <option value="">请选择</option>>
                      <volist name="status" id="voo">
                          <option value="{$key}" <eq name="_GET.status" value="$key">selected</eq> >{$voo}</option>
                      </volist>
                  </select>
              </div>

              <div class="sleft">
                  <select id="time_type" name="time_type" class="fl">
                      <option value="ctime">交易时间</option>
                  </select>
                  <input type="text" name="start_time" class="search-input w-100 date_select" value="{:I('get.start_time')}" placeholder="开始"/>
                  <span class="fl line-h">至</span>
                  <input type="text" name="end_time" class="search-input w-100 date_select" value="{:I('get.end_time')}" placeholder="结束"/>
                  <a class="sch-btn" href="javascript:;" id="search" onclick="$('#J_search-form').submit()"><i class="btn-search"></i></a>
              </div>
          </div>
      </form>
  </div>

  <!-- 数据表格 -->
  <div class="data-table table-striped">
    <form class="ids">
      <table>
        <thead>
        <tr>
          <th class="row-selected">
            <input class="checkbox check-all" type="checkbox">
          </th>
          <th>交易ID</th>
          <th>店铺名称</th>
          <th>提现银行</th>
          <th>提现账号</th>
          <th>提现金额</th>
          <th>手续费</th>
          <th>提现备注</th>
          <th>申请时间</th>
          <th>提现状态</th>
          <th width="80">操作</th>
        </tr>
        </thead>
        <tbody>
        <notempty name="list">
          <volist name="list" id="vo">
            <tr>
              <td><input class="ids row-selected" type="checkbox" name="ids[]" value="{$vo.id}"></td>
              <td>{$vo.id}</td>
              <td>{:store_name($vo['store_id'])}</td>
              <td>{$vo.back_name}</td>
              <td>{$vo.back_account}</td>
              <td>{:sprintf('%.2f', $vo['amount'])}</td>
              <td>{:sprintf('%.2f', $vo['fee'])}</td>
              <td>{$vo.memo}</td>
              <td>{$vo.ctime|time_format}</td>
              <td>{$vo.status|get_store_withdraw_text}</td>
              <if condition="($vo['status'] eq 1) OR ($vo['status'] eq 3)">
              <td><a href="javascript:;" onclick="UI.load('{:U('storeEdit?id='.$vo['id'])}', '处理提现')">[处理提现]</a></td>
              <else />
              <td></td>
              </if>
            </tr>
          </volist>
          <else/>
          <tr><td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td></tr>
        </notempty>
        </tbody>
      </table>
    </form>
    <!-- 分页 -->
    <div class="page">{$_page}</div>
  </div>
</block>

<block name="script">
    <script language="javascript" type="text/javascript" src="__PUBLIC__/Admin/js/My97Date/WdatePicker.js"></script>
    <script type="text/javascript">
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        //搜索下拉菜单及时过滤
        $('#J_search-form select').change(function(){
            $("#search").click();
        });
        //设置单选，复选，下拉菜单的值
        Core.setValue('type', '{$_GET['type']|default = ""}');
        //导航高亮
        highlight_subnav("{:U('Store/bill')}");
        //时间选择
        $('.date_select').focus(function(){
            WdatePicker({skin: 'twoer', dateFmt: 'yyyy-MM-dd', maxDate: '%y-%M-%d'});
        });
    </script>
</block>
